import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import {DiscussionComponent} from './dashboard/discussion/discussion.component';
import {RoomComponent} from './dashboard/room/room.component';
import {LoginComponent} from './login/login.component';
import {AboutComponent} from './dashboard/about/about.component';
import {SubroomComponent} from './dashboard/subroom/subroom.component';
import {Page404Component} from './page404/page404.component';
import {AuthGuard} from "./auth/auth.guard"
import {RegComponent} from './reg/reg.component';


const routes: Routes = [
  {path:'login', component: LoginComponent},
  {path: 'reg', component: RegComponent},
  {path: 'room', component: RoomComponent},
  {path: 'discussion', component: DiscussionComponent},
  {path: 'about', component: AboutComponent},
  {path: 'subroom/:id', component: SubroomComponent, canActivate:[AuthGuard]},
  {path: '', component: RoomComponent},
  {path: '**', component: Page404Component}

];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
